import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @ClassName Demo03_PropertiesStore
 * @Description store 方法
 * @Author Li
 * @Date 2022/8/11 14:57
 * @ModifyDate 2022/8/11 14:57
 * @Version 1.0
 */
public class Demo03_PropertiesStore {
    public static void main(String[] args) throws IOException {
        File profile = new File("src/part09/ch05_Properties/connection.properties");
        FileOutputStream fos = new FileOutputStream(profile);
        Properties pro = new Properties();
        pro.setProperty("host", "127.0.0.1");
        pro.setProperty("port", "3306");
        pro.setProperty("username", "root");
        pro.setProperty("password", "123456");
        pro.store(fos, "Write properties to local");
        fos.close();
    }
}
